#!/bin/sh

set -e

replaceAnswer() {
    answerPath=$1

    rm -rf ./${answerPath}/*
    mv ../simpleCodingQuiz-submit-${BUILD_NUMBER}/${answerPath}/* ./${answerPath}
}

if [ "$(echo $image | grep "node")" != "" ]
then
   replaceAnswer 'main'
elif [ "$(echo $image | grep "java")" != "" ]
then
   replaceAnswer 'src/main'
   replaceAnswer 'src/test'
else
    echo 'none'
fi
